<?php
if(isset($_POST['validar'])){
	$senha=$_POST['senha'];
	if($senha=='manager'){
		$teste="OK";
	}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Configurar</title>
<style type="text/css">
<!--
.style13 {font-size: 12px;
	font-family: Arial, Helvetica, sans-serif;
	font-weight: bold;
}
.style14 {font-size: 24px;
	font-family: Arial, Helvetica, sans-serif;
	font-weight: bold;
	color:#333;
}
.style7 {font-size: 12px; font-weight: bold; font-family: Verdana, Arial, Helvetica, sans-serif; }
-->
</style>
</head>

<body>

<?php
if($teste=='OK'){
	
require_once("../model/Banco_Dados.php");

$banco=new Banco_Dados();

?>
<form id="form2" name="form2" method="post" action="../int/Config_int.php">
  <table width="419" border="0" align="center">
    <tr>
      <td align="right">&nbsp;</td>
      <td align="left" valign="middle" class="style14">&nbsp;</td>
    </tr>
    <tr>
      <td width="155" align="right"><img src="../img/net.png" alt="" width="100" height="99" /></td>
      <td width="320" align="left" valign="middle" class="style14">Configurações</td>
    </tr>
    <tr>
      <td align="right"><span class="style13">Host:.</span></td>
      <td align="left"><input name="host" value="<?php echo $banco->getHost(); ?>" type="text" id="host" size="20" maxlength="20" style=" font-size:10pt; color: #333333; border: 1px solid #666666; background-color: #FFFFFF; height: 20px; " /></td>
    </tr>
    <tr>
      <td align="right" class="style13">User:.</td>
      <td align="left"><input name="user" type="text" id="user" size="20" value="<?php echo $banco->getUser(); ?>" maxlength="20" style=" font-size:10pt; color: #333333; border: 1px solid #666666;  background-color: #FFFFFF; height: 20px; " /></td>
    </tr>
    <tr>
      <td align="right" class="style13">Password:.</td>
      <td align="left"><input name="paswd" type="password" value="<?php echo $banco->getPaswd(); ?>" id="paswd" size="20" maxlength="20" style=" font-size:10pt; color: #333333; border: 1px solid #666666; background-color: #FFFFFF; height: 20px; " /></td>
    </tr>
    <tr>
      <td align="right" class="style13">Banco:.</td>
      <td align="left"><input name="banco" type="text" value="<?php echo $banco->getBanco(); ?>" id="banco" size="20" maxlength="20" style=" font-size:10pt; color: #333333; border: 1px solid #666666; background-color: #FFFFFF; height: 20px; " /></td>
    </tr>
    <tr>
      <td align="right" class="style13">Porta:.</td>
      <td align="left"><input name="porta" type="text" value="<?php echo $banco->getPorta(); ?>" id="porta" size="20" maxlength="20" style=" font-size:10pt; color: #333333; border: 1px solid #666666; background-color: #FFFFFF; height: 20px; " /></td>
    </tr>
    <tr>
      <td align="right">&nbsp;</td>
      <td align="left">&nbsp;</td>
    </tr>
    <tr>
      <td align="right">&nbsp;</td>
      <td height="25" align="left"><span class="style7">
        <input type="submit" name="salvar" id="salvar" value="Salvar Configurações" style="background:#000000; color:#FFFFFF; border:#000000" />
      </span></td>
    </tr>
    <tr>
      <td align="right">&nbsp;</td>
      <td align="left">&nbsp;</td>
    </tr>
  </table>
</form>
<?php
}else{
?>
<form id="form1" name="form1" method="post" action="">
  <table width="300" border="0" align="center">
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td width="79">&nbsp;</td>
      <td width="211"><input name="senha" type="password"  id="senha" size="20" maxlength="20" style=" font-size:10pt; color: #333333; border: 1px solid #666666; background-color: #FFFFFF; height: 20px; " /></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><span class="style7">
        <input type="submit" name="validar" id="validar" value="Validar" style="background:#000000; color:#FFFFFF; border:#000000" />
      </span></td>
    </tr>
  </table>
  <?php
}
  ?>
</form>
</body>
</html>